package com.tjy.farmer.service.impl;

import java.util.List;

import com.tjy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tjy.farmer.mapper.FarmerAlarmMapper;
import com.tjy.farmer.domain.FarmerAlarm;
import com.tjy.farmer.service.IFarmerAlarmService;

/**
 * 蜂农越界报警记录Service业务层处理
 *
 * @author tjy
 * @date 2025-09-16
 */
@Service
public class FarmerAlarmServiceImpl implements IFarmerAlarmService {
    @Autowired
    private FarmerAlarmMapper farmerAlarmMapper;

    /**
     * 查询蜂农越界报警记录
     *
     * @param id 蜂农越界报警记录主键
     * @return 蜂农越界报警记录
     */
    @Override
    public FarmerAlarm selectFarmerAlarmById(Long id) {
        return farmerAlarmMapper.selectFarmerAlarmById(id);
    }

    /**
     * 查询蜂农越界报警记录列表
     *
     * @param farmerAlarm 蜂农越界报警记录
     * @return 蜂农越界报警记录
     */
    @Override
    public List<FarmerAlarm> selectFarmerAlarmList(FarmerAlarm farmerAlarm) {
        return farmerAlarmMapper.selectFarmerAlarmList(farmerAlarm);
    }

    /**
     * 新增蜂农越界报警记录
     *
     * @param farmerAlarm 蜂农越界报警记录
     * @return 结果
     */
    @Override
    public int insertFarmerAlarm(FarmerAlarm farmerAlarm) {
        farmerAlarm.setCreateTime(DateUtils.getNowDate());
        return farmerAlarmMapper.insertFarmerAlarm(farmerAlarm);
    }

    /**
     * 修改蜂农越界报警记录
     *
     * @param farmerAlarm 蜂农越界报警记录
     * @return 结果
     */
    @Override
    public int updateFarmerAlarm(FarmerAlarm farmerAlarm) {
        farmerAlarm.setUpdateTime(DateUtils.getNowDate());
        return farmerAlarmMapper.updateFarmerAlarm(farmerAlarm);
    }

    /**
     * 批量删除蜂农越界报警记录
     *
     * @param ids 需要删除的蜂农越界报警记录主键
     * @return 结果
     */
    @Override
    public int deleteFarmerAlarmByIds(Long[] ids) {
        return farmerAlarmMapper.deleteFarmerAlarmByIds(ids);
    }

    /**
     * 删除蜂农越界报警记录信息
     *
     * @param id 蜂农越界报警记录主键
     * @return 结果
     */
    @Override
    public int deleteFarmerAlarmById(Long id) {
        return farmerAlarmMapper.deleteFarmerAlarmById(id);
    }
}
